$startDate = new DateTime("2019-10-27");
$endDate = new DateTime("2020-04-11");
$difference = $endDate->diff($startDate);
echo $difference->format("%a");
$now = time(); // or your date as well
$your_date = strtotime("2010-01-31");
$datediff = $now - $your_date;
echo round($datediff / (60 * 60 * 24));
date('Y/m/d',strtotime("-1 days"));
Or Use DateTime class like this-
$date = new DateTime();
echo $date->modify("-1 days")->format('Y-m-d');